<template "own/default/public/head" />
<template tplx="login_index">
    <template "own/default/public/tab" />
    <div class="login-body" x-show="tabNow=='name'||tabNow=='band'">
        <form @submit.prevent="goLogin">
            <div class="login-input">
                <input type="text" name="name" placeholder="账号/邮箱/手机号" required x-model="form.name" />
            </div>
            <div class="login-input">
                <input type="password" name="pass" placeholder="密码" required x-model="form.pass" />
            </div>
            <div class="login-input">
                <input type="number" placeholder="验证码" autocomplete="off" maxlength="6" autocomplete="new-input" required x-model="form.code" />
                <img :src="$store.login.captcha" title="点击刷新" @click="$store.login.resetCaptcha()" />
            </div>
            <div class="login-readme">
                <label>
                    <input type="checkbox" checked="checked" required />
                    阅读并同意
                </label>
                <a href="javascript:;" @click="$store.login.openAgree('user','用户协议')">《用户协议》</a>
                <a href="javascript:;" @click="$store.login.openAgree('privacy','隐私声明')">《隐私声明》</a>
            </div>
            <button class="login-btn" type="submit">{{$page['btn']}}</button>
        </form>
    </div>
    <if $UCFG['reg']['qrcode'] gt 0>
        <div class="login-body" x-show="tabNow=='wechat'">
            <div class="login-qr-tips">
                <if in_array($UCFG['reg']['on'],["mobile","email"])>
                    请先 <a href="{{$_L['url']['own']}}rootid={{$_L['ROOTID']}}&n=login&c=reg&go={{urlencode($_L['form']['go'])}}">注册账号</a>，再使用 <span>第三方登录</span>
                    <else />
                    请使用微信扫码
                </if>
            </div>
            <div class="login-qr">
                <block x-if="qrcode.wechat">
                    <img :src="`${LCMS.url.qrcode}${encodeURIComponent(qrcode.wechat)}`" />
                </block>
                <div class="login-refresh" x-show="reload.wechat">
                    二维码已过期
                    <span @click="reloadQrcode('wechat')">刷新</span>
                </div>
            </div>
        </div>
    </if>
    <if $UCFG['reg']['qqlogin'] gt 0>
        <div class="login-body" x-show="tabNow=='qq'">
            <div class="login-qr-tips">
                <if in_array($UCFG['reg']['on'],["mobile","email"])>
                    请先 <a href="{{$_L['url']['own']}}rootid={{$_L['ROOTID']}}&n=login&c=reg&go={{urlencode($_L['form']['go'])}}">注册账号</a>，再使用 <span>第三方登录</span>
                    <else />
                    请使用手机QQ扫码，或直接点击QQ登录
                </if>
            </div>
            <div class="login-qr login-qr-qqlogin">
                <block x-if="qrcode.qq">
                    <img :src="`${LCMS.url.qrcode}${encodeURIComponent(qrcode.qq)}`" />
                </block>
                <div class="login-refresh" x-show="reload.qq">
                    二维码已过期
                    <span @click="reloadQrcode('qq')">刷新</span>
                </div>
            </div>
            <div style="text-align:center;padding:20px 0 0 0">
                <a :href="qrcode.qq" target="_blank"><img src="/public/static/images/qqlogin.png" /></a>
            </div>
        </div>
    </if>
</template>
<if $LF['action']!="band">
    <div class="login-link">
        <if in_array($UCFG['reg']['on'],["mobile","email"])>
            <a href="{{$_L['url']['own']}}rootid={{$_L['ROOTID']}}&n=login&c=reg&go={{urlencode($_L['form']['go'])}}">注册账号</a>
            <if $UCFG['reg']['findpass'] gt 0>
                <div class="login-link-line"></div>
            </if>
        </if>
        <if $UCFG['reg']['findpass'] gt 0>
            <a href="{{$_L['url']['own']}}rootid={{$_L['ROOTID']}}&n=login&c=find&go={{urlencode($_L['form']['go'])}}">忘记密码</a>
        </if>
    </div>
</if>
<template "own/default/public/foot" />